package com.jrx.anytxn.reporting.service.impl;

import com.jrx.anytxn.common.uitl.BeanMapping;
import com.jrx.anytxn.reporting.dto.MrRepaymentPlanRes;
import com.jrx.anytxn.reporting.entity.MrRepaymentPlan;
import com.jrx.anytxn.reporting.mapper.ext.ExtMrRepaymentPlanMapper;
import com.jrx.anytxn.reporting.service.IRepayPlanService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author xqy
 * @version 1.0
 * @date 2020/4/20
 */
@Service
public class RepayPlanServiceImpl implements IRepayPlanService {

    @Resource
    private ExtMrRepaymentPlanMapper extMrRepaymentPlanMapper;
    @Override
    public List<MrRepaymentPlanRes> getRepaymentPlanResByTenantIdAndLoanIdAndCusId(String tenantId, String loanId, String customerId) {
        List<MrRepaymentPlan> mrRepaymentPlans = extMrRepaymentPlanMapper.selectRepaymentPlanResByTenantIdAndLoanIdAndCusId(tenantId, loanId, customerId);
        return BeanMapping.copyList(mrRepaymentPlans, MrRepaymentPlanRes.class);
    }
}